package com.aube.push;

import com.huyn.baseframework.model.CategorySimple;
import com.huyn.baseframework.model.ChannelDetail;
import com.huyn.baseframework.model.Character;

import org.json.JSONObject;

/**
 * Created by huyaonan on 16/7/20.
 */
public class PushModelBuilder {

    public static Character buildCharacter(JSONObject object) {
        Character character = new Character();
        character.actorName = object.optString("actorName");
        character.relatedId = object.optString("relatedId");
        return character;
    }

    public static CategorySimple buildCategory(JSONObject object) {
        CategorySimple categorySimple = new CategorySimple();
        categorySimple.templateType = object.optString("templateCode");
        categorySimple.relatedId = object.optString("relatedId");
        categorySimple.modelCode = object.optString("modelCode");
        categorySimple.subModelCode = object.optString("subModelCode");
        return categorySimple;
    }

    public static ChannelDetail buildVideo(JSONObject object) {
        ChannelDetail channel = new ChannelDetail();
        channel.cameraType = object.optString("cameraType");
        channel.leftRightAngle = object.optString("leftRightAngle");
        channel.updownAngle = object.optString("updownAngle");
        channel.videoDesc = object.optString("videoDesc");
        channel.videono = object.optString("videono");
        channel.videoid = object.optString("videoid");
        channel.videoTitle = object.optString("videoTitle");
        channel.showid = object.optString("showid");
//        channel.picurl = object.optString("picurl");
        return channel;
    }


}
